package com.example.personal.aiagent.user.model.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import javax.validation.constraints.Pattern;

/**
 * 用户请求
 */
@Data
public class UserRequest {
    /**
     * 密码
     * 以字母开头，长度在6~18之间，只能包含字母、数字
     */
    @JsonProperty("password")
    @Pattern(regexp = "^[a-zA-Z][a-zA-Z0-9]{5,17}$",
            message = "password format invalid, should start with letter, container letter or number, length 6-18")
    private String password;

    /**
     * 用户名
     * 长度在6~18之间，只能包含字母、数字
     */
    @Pattern(regexp = "[a-zA-Z0-9]{6,18}$",
            message = "username format invalid, should container letter or number, length 6-18")
    @JsonProperty("username")
    private String username;
}
